home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / prodpack.zip / DB4PPSRC.EXE / _FWRITE0.PRG < prev    next >
Text File  |  1993-05-04  |  1KB  |  43 lines

  1. FUNCTION _FWrite0
  2. PARAMETERS ph_file, pn_nulls
  3. *--------------------------------------------------------------------
  4. * NAME
  5. *   _FWrite0 - Write number of CHR(0)s to open file.
  6. *
  7. * SYNOPSIS
  8. *   _FWrite0( ph_file, pn_nulls )
  9. *
  10. * DESCRIPTION
  11. *   _FWrite0 will write out to an open file handle <ph_file>,
  12. *   <pn_nulls> null characters ( 00h ).  This is useful since
  13. *   REPLICATE() currently does not support CHR(0).
  14. *
  15. * PARAMETERS
  16. *   ph_file  - numeric file handle of the target file.
  17. *   pn_nulls - number of CHR(0)s to output.
  18. *
  19. * EXAMPLE
  20. *   * Write 100 nulls to the start of "MYFILE.TXT":
  21. *   lh_file = FOPEN( "MYFILE.TXT", "rw" )
  22. *   ln_var  = FWrite0( lh_file, 100 )
  23. *   ln_mem  = FCLOSE( "MYFILE.TXT" )
  24. *
  25. * SEE ALSO
  26. *   FOPEN(), FWRITE()
  27. *--------------------------------------------------------------------
  28.  
  29.   PRIVATE ln_count, ln_chrs
  30.  
  31.   ln_count = 1
  32.  
  33.   DO WHILE m->ln_count <= m->pn_nulls
  34.     ln_chrs = FWRITE( m->ph_file, CHR(0) )
  35.     ln_count = m->ln_count + 1
  36.   ENDDO
  37.  
  38. RETURN( m->pn_nulls )
  39. *-- EOF: _FWrite0( ph_file, pn_nulls )
  40.  
  41.  
  42.  
  43.